package javango.api;

import java.util.ArrayList;
import java.util.List;

import javango.http.HttpRequest;
import javango.http.SimpleHttpResponse;

public class BaseUrls implements Urls {
	
	public SimpleHttpResponse index(HttpRequest request) {
		return new SimpleHttpResponse("Javango is running, please configure your Urls.");
	}
	
	List<Url> urls;
		
	public List<Url> getUrlPatterns() {
		if (urls == null) {
			List<Url> l = new ArrayList<Url>();
			l.add(new javango.core.RegUrl("^.*$", BaseUrls.class, "index"));
			return l;
		}
		return urls;
	}

    final public void addUrlPatterns(Url ...urlArray) {
        if (urls != null) {
            urls = new ArrayList<Url>();
        }
        urls = new ArrayList<Url>();
        for (Url url : urlArray) {
            urls.add(url);
        }
    }
}
